package com.laoyang.rabbit;

import com.alibaba.fastjson.JSON;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Date;

/**
 * @author com.yyy
 * @Date 2020-09-12 12:39
 * @Email yangyouyuhd@163.com
 */
public class 获取泛型 {

    public static void main(String[] args) throws Exception {
        RabbitTemplate.send(new User("张三",18,new Date()));
    }
    @RabbitListener
    public void hello(Message<User> message){
        System.out.println("获取的消息："+message);
        System.out.println("获取的消息体："+message.getBody());
    }
}
